package cn.itcast.io.a.file.filefilter;

import java.io.File;
import java.io.FilenameFilter;

public class FileNameFilterBySuffix implements FilenameFilter {
    
    private String suffix;

    public FileNameFilterBySuffix(String suffix) {
        this.suffix = suffix;
    }

    @Override
    public boolean accept(File dir, String name) {
        
        return name.endsWith(suffix);
        
    }
}
